<?php

namespace App\Http\Controllers\Home;

use App\Http\Controllers\Controller;
use App\Model\ArticleModel;
use App\Model\ImageModel;
use Illuminate\Http\Request;

class IndexController extends Controller
{
    //
    public function index() {
        //获取幻灯片
        $imageModel = new ImageModel;
        $images = $imageModel->getImagesBySort();

        //获取文章列表
        $articleModel = new ArticleModel;
        $articles = $articleModel->getIndexArt();

        //获取点赞最多的文章
        $getLikeArts = $articleModel->getLikeArt();

        return view('home.index' , compact('images','articles','getLikeArts'));
    }
}
